﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace ZeroTouchUI
{
    /// <summary>
    /// Interaction logic for Load.xaml
    /// </summary>
    public partial class Load : Window
    {
        Profile profile;
        MainWindow mainWindow;
        public Load(MainWindow mW)
        {
            InitializeComponent();
            profile = new Profile();
            mainWindow = mW;
        }

        public Load(Profile p, MainWindow mW)
        {
            InitializeComponent();
            profile = p;
            mainWindow = mW;
        }

        private void cancel_Click(object sender, RoutedEventArgs e)
        {
            this.Close();
        }

        private void load_Click(object sender, RoutedEventArgs e)
        {
            profile = profile.LoadProfile(this.profileName.Text, profile);
            mainWindow.profile = profile;
            mainWindow.RefreshName();
            this.Close();
        }
    }
}
